package cn.buddha.jec.flowable;

import cn.buddha.jec.flowable.core.IFlowable;
import cn.buddha.jec.util.TongSpringContextUtils;
import org.springframework.stereotype.Component;

/**
 * @ClassName FlowableExecute
 * @Author 友野浩二
 * @Date 2020/4/1 15:50
 * @Description 服务流程入口
 * @Version 1.0
 */
@Component
public class FlowableExecute {

    /**
     * @return OUT
     * @Author 友野浩二
     * @Description // 服务流程入口
     * @Date 2020/4/1 19:56
     * @Param [beanName, input]
     */
    public <IN, OUT> OUT start(String beanName, IN input) {
        IFlowable iFlowable = TongSpringContextUtils.getBean(beanName);
        return ((OUT) iFlowable.execute(beanName, input));
    }

}
